<template>
<el-form ref="form" :model="form" label-width="80px" class="login">
    <el-form-item label="用户名:">
        <el-input v-model="form.name"></el-input>
    </el-form-item>
    <el-form-item label="密码:">
        <el-input placeholder="请输入密码" v-model="form.region" show-password></el-input>
    </el-form-item>

    <el-form-item>
        <el-button type="primary" @click="onSubmit">立即登陆</el-button>
        <el-button>取消</el-button>
    </el-form-item>
</el-form>
</template>

<script>
import * as Ajax from '@/plugins/Home'; // 引入axios 目的结构化管理

export default {
name: 'login',
data() {
  return {
    form: {
      name: '',
      region: '',
    },
  }
},
created(){
  console.log(1212)
},
methods: {
  onSubmit() {
    const postData={
      a:11,
      b:22,
    }
    Ajax.login(postData)


  }


}
}
</script>
<style scoped>
.login {
    width: 300px;
    margin: 30px auto;
}
</style>
